﻿<%@ Page Language="C#" MasterPageFile="~/Administrator/Admin.master" AutoEventWireup="true"
    Inherits="Administrator_AdminProductCategorys" Title="Quản trị Danh Mục Sản Phẩm"
    CodeBehind="AdminProductCategorys.aspx.cs" %>

<%@ Register Src="~/Administrator/Controls/PaggingControl.ascx" TagName="PaggingControl"
    TagPrefix="EHT" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h1>
        <asp:Label ID="lbAdminCategory" runat="server" Text="Danh mục sản phẩm"></asp:Label>
    </h1>
    <p class="submitButton">
        <asp:Button ID="btnAdd" runat="server" Text="Thêm mới danh mục sản phẩm" OnClick="btnAdd_Click"
            CssClass="btn_action" />
    </p>
    <table style="width: 100%; height: 50px;" class="data-table">
        <tr>
            <td style="width: 30%" valign="top">
                <asp:TreeView ID="tvCategorys" runat="server" ShowLines="True" OnSelectedNodeChanged="tvCategorys_SelectedNodeChanged">
                </asp:TreeView>
            </td>
            <td style="width: 70%" valign="top">
                <span style="color:Red"><asp:Label ID="lbMessage" runat="server"></asp:Label></span>
                <br />
                <asp:Repeater ID="rpDanhMucSanPham" runat="server" OnItemCommand="rpDanhMucSanPham_ItemCommand">
                    <HeaderTemplate>
                        <table cellspacing="0" cellpadding="0" class="data-table">
                            <thead>
                                <tr>
                                    <th class="actions delete">
                                        STT
                                    </th>
                                    <th class="actions edit">
                                        Sửa
                                    </th>
                                    <th class="actions delete">
                                        Xóa
                                    </th>
                                    <th>
                                        Tên danh mục (VN)
                                    </th>
                                    <th class="OtherLanguage">
                                        Tên danh mục (Other)
                                    </th>
                                    <th>
                                        SL truy cập
                                    </th>
                                    <th class="number_of_order">
                                        Thứ tự
                                        <asp:ImageButton ID="ibtnSaveAll" ImageUrl="Templates/Images/save_all.jpg" Height="20"
                                            Width="20" OnClientClick="return confirm('Bạn muốn lưu ?');" runat="server" BorderStyle="None"
                                            CommandName="save_all" />
                                    </th>
                                    <th class="publish">
                                        Hiển thị
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <%# Container.ItemIndex + 1 %>
                            </td>
                            <td class="actions edit">
                                <a href='AdminProductCategoryIU.aspx?DanhMucID=<%#Eval("DanhMucID")%>'>
                                    <img alt="Edit" src="Templates/Images/Edit.png"></a>
                                <asp:Literal ID="ltrDanhMucSanPhamID" runat="server" Visible="false" Text='<%#Eval("DanhMucID")%>'></asp:Literal>
                            </td>
                            <td class="actions delete">
                                <a href='#'>
                                    <asp:ImageButton ID="btnDelete" ToolTip="Delete" CommandName="delete1" runat="server"
                                        ImageUrl="Templates/Images/Delete.png" CommandArgument='<%#Eval("DanhMucID")%>'
                                        OnClientClick="return confirm('Bạn có muốn xóa danh mục sản phẩm này không ?');  " />
                            </td>
                            <th>
                                <%#Eval("TenDanhMucVN") %>
                            </th>
                            <th class="OtherLanguage">
                                <%#Eval("TenDanhMucOther") %>
                            </th>
                            <td>
                                <%#Eval("LuongTruyCap") %>
                            </td>
                            <td>
                                <asp:TextBox ID="txtNumberOfOrder" Width="30" runat="server" Text='<%#Eval("SapXep")%>'></asp:TextBox>
                                <asp:ImageButton Width="16" Height="16" ID="btnSaveNumberOfOrder" CommandName="change_number_of_order"
                                    CommandArgument='<%#Eval("DanhMucID") %>' ImageUrl="Templates/Images/save.jpg"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:CheckBox ID="ckPublish" runat="server" Checked='<%#Eval("Publish")%>' Visible="false" />
                                <asp:ImageButton Width="16" Height="16" ID="btnPublish" CommandName="publish" CommandArgument='<%#Eval("DanhMucID") %>'
                                    ImageUrl="Templates/Images/btncheck.png" runat="server" />
                                <%--<asp:CheckBox ID="ckPublish" runat="server" Checked='<%#Eval("Publish")%>' Visible="false" />--%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </tbody> </table>
                    </FooterTemplate>
                </asp:Repeater>
                <br />
                <EHT:PaggingControl ID="PaggingControl1" runat="server" PageURL="AdminProducts.aspx"
                    PageSize="10" />
            </td>
        </tr>
    </table>
</asp:Content>
